package com.zara.store.server;

import java.util.Collection;
import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.ejb.Stateless;

import com.zara.store.common.EnvtVO;
import com.zara.store.common.InvoiceVO;
import com.zara.store.common.OfadVO;
import com.zara.store.common.PalcItemVO;
import com.zara.store.common.PalcItemViewVO;
import com.zara.store.common.PalcVO;
import com.zara.store.common.ProductVO;

@Remote
public @Stateless class StoreFacadeBean implements StoreFacade {
		
	InvoiceBusiness invoiceBusiness;
	ProcessBusiness processBusiness;

	public InvoiceBusiness getInvoiceBusiness() {
		return invoiceBusiness;	
	}
	
	@EJB(name="ejb/InvoiceBusinessBean")
	public void setInvoiceBusiness(InvoiceBusiness invoiceBusiness) {
		this.invoiceBusiness = invoiceBusiness;
	}

	public ProcessBusiness getProcessBusiness() {
		return processBusiness;
	}

	@EJB(name="ejb/ProcessBusinessBean")
	public void setProcessBusiness(ProcessBusiness processBusiness) {
		this.processBusiness = processBusiness;
	}

	public ProductVO queryProduct(String barcode){
		return invoiceBusiness.queryProduct(barcode);
	}

	public InvoiceVO createInvoice(InvoiceVO invoice) {
		return invoiceBusiness.createInvoice(invoice);
	}
	
	public Collection<PalcItemViewVO> queryPalcProductList() {
		return processBusiness.queryPalcProductList();
	}
	
	public PalcVO createPalc(List<PalcItemVO> items) {
		return processBusiness.createPalc(items);
	}

	public OfadVO createOfad(OfadVO ofad){
		return processBusiness.createOfad(ofad);
	}

	public EnvtVO createEnvt(EnvtVO envtVO) {
		return processBusiness.createEnvt(envtVO);
	}

}
